home *** CD-ROM | disk | FTP | other *** search
/ Freelog 125 / Freelog_MarsAvril2015_No125.iso / Musique / Quod Libet / quodlibet-3.3.0-installer.exe / bin / quodlibet / ext / events / iradiolog.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2014-12-31  |  1KB  |  36 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.7)
  3.  
  4. from quodlibet import app
  5. from quodlibet.plugins.events import EventPlugin
  6.  
  7. class IRadioLog(EventPlugin):
  8.     PLUGIN_ID = 'Internet Radio Log'
  9.     PLUGIN_NAME = _('Internet Radio Log')
  10.     PLUGIN_DESC = _('Record the last 10 songs played on radio stations, and list them in the seek context menu.')
  11.     PLUGIN_ICON = 'gtk-edit'
  12.     PLUGIN_VERSION = '0.22'
  13.     
  14.     def plugin_on_song_started(self, song):
  15.         if song is None:
  16.             return None
  17.         player = None.player
  18.         if player.song.multisong and not (song.multisong):
  19.             time = player.get_position()
  20.             title = song('title')
  21.             bookmarks = player.song.bookmarks
  22.             bookmarks.append([
  23.                 time // 1000,
  24.                 title])
  25.             
  26.             try:
  27.                 bookmarks.pop(-10)
  28.             except IndexError:
  29.                 pass
  30.  
  31.             player.song.bookmarks = bookmarks
  32.         elif song.multisong:
  33.             song.bookmarks = []
  34.  
  35.  
  36.